Highlight an object in a module issue

I wish to be able to run a script which will place the cursor on an object that the script determines to be "empty"
When I run this, I print out the correct object, but the cursor does not move to the object as I expect it to.

My script follows:
 

string strBaseID
string strBlank = ""
string strSpace = " "
 
Object o
Module m = current
bool bBlankResult
string strModuleName = m."Name"  // Get the complete DVP name
string strTemp
int nLength = 0
string strObjectText = strBlank
 
for o in m do
{
        if (probeAttr_(o, "VV Test Identifier") == "Result")
        {
                bBlankResult = true
                // Look for a result step that has Test Status empty
                if (probeAttr_(o, "Test Status") == "DEFERRED")
                        bBlankResult = false
                else if (probeAttr_(o, "Test Status") == "ANALYZED")
                        bBlankResult = false
                else if (probeAttr_(o, "Test Status") == "PASS")
                        bBlankResult = false
                else if (probeAttr_(o, "Test Status") == "FAIL")
                        bBlankResult = false
                if (bBlankResult)
                {
                        strObjectText = o."Object Text"
                        nLength = length(strObjectText)
                        strBaseID = strSpace probeAttr_(o, "Base ID") strSpace
                        strTemp = "Blank Result at BaseID" strBaseID strNewLine
                        print strTemp
                        highlightText(o, 1, nLength, 1, false)
                        halt
                } // end if (bBlankResult)
        }  
        else if((probeAttr_(o, "VV Test Identifier") == "Tester Input") && (probeAttr_(o, "Test Comment") == strBlank))// Blank string
        {
                strObjectText = o."Object Text"
                strBaseID = strSpace probeAttr_(o, BID) strSpace
                strTemp = "Tester Input Blank at BaseID" strBaseID strNewLine
                print strTemp
                nLength = length(strObjectText)
                highlightText(o, 1, nLength, 1, false)
                halt
        }
} // end for o in m do

 


Any suggestions?

 


Gedinfo - Thu Nov 15 13:47:10 EST 2012

Re: Highlight an object in a module issue
llandale - Thu Nov 15 14:53:38 EST 2012

It seems function "highlightText" works on the "current" object, not the one specified.
Put this before the hightlightText() function:
  • current = o
I wonder if you need this afterwards but I doubt it:
  • refresh(m)

-Louie

I'd be tempted to change your loop such that it finds the NEXT object with an issue:
  • Object oCurr = current
  • o = next(oCurr)
  • while(!null o)
  • { if (probe...
    • bla bla
    • o = next(o)
  • }

Re: Highlight an object in a module issue
Gedinfo - Thu Nov 15 15:32:45 EST 2012

Thank you Louie.

I did not see any reference to the object being current for highlightText().

This script now works as expected.